package com.mymoney.persistence.managers;

import java.util.List;

import com.mymoney.beans.PlatformBean;
import com.mymoney.exceptions.MyMoneyException;
import com.mymoney.persistence.PersistenceContext;

/**
 * 
 * @author yavor.gologanov
 *
 */
public class PlatformManager extends AbstractBeanManager<PlatformBean> {

	public PlatformManager(PersistenceContext persistenceContext) {
		super(persistenceContext);
	}

	@Override
	public void add(PlatformBean entity) throws MyMoneyException {
		throw new MyMoneyException("Method is not implemented!");
		
	}


	@Override
	public List<PlatformBean> list() throws MyMoneyException {
		
		String queryString = "select d from PlatformBean d";
		List<PlatformBean> platforms = findAllEntities(queryString, -1,(Object[]) null);
		return platforms;
	}


	@Override
	public PlatformBean getByCode(long code) throws MyMoneyException {
		
		return getBy("select p from PlatformBean p where p.code = :code", code, "code");
	}


	@Override
	public PlatformBean getById(Integer id) throws MyMoneyException {
		
		return getBy("select p from PlatformBean p where p.id = :id", id, "id");
	}


	@Override
	public PlatformBean getByName(String name) throws MyMoneyException {
		
		return getBy("select p from PlatformBean p where p.name = :name", name, "name");
	}


	@Override
	public void update(PlatformBean first, PlatformBean second)
			throws MyMoneyException {
		throw new MyMoneyException("Method is not implemented!");
		
	}


	@Override
	public void update(PlatformBean entity, long code) throws MyMoneyException {
		throw new MyMoneyException("Method is not implemented!");
		
	}


	@Override
	public void update(PlatformBean entity, Integer id) throws MyMoneyException {
		throw new MyMoneyException("Method is not implemented!");
		
	}


	@Override
	public void update(PlatformBean entity, String name)
			throws MyMoneyException {
		throw new MyMoneyException("Method is not implemented!");
		
	}

}
